﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CYTS.Aoyou.Framework.Context
{
    /// <summary>
    /// 默认上下文处理类
    /// </summary>
    public class DefaultContextHandler : IContextHandler
    {
        [ThreadStatic]
        private static WebContext _ContextThreadInstance;

        public WebContext GetContext()
        {
            if (_ContextThreadInstance == null)
            {
                _ContextThreadInstance = new WebContext();
            }

            return _ContextThreadInstance;
        }

        public void SetContext(WebContext context)
        {
            _ContextThreadInstance = context;
        }
    }
}
